import 'dart:async';

import 'package:get/get.dart';
import 'package:largefriends/config/lf_route.dart';
import 'package:largefriends/service/lf_auth_service.dart';

import '../../../events/user_change_event.dart';
import '../../../service/manager/lf_event_helper.dart';

toEditBasic() {
  Get.toNamed(LFRoute.pathEditBasic);
}

class LfEditBasicLogic extends GetxController {
  LfAuthService authService = Get.find();
  late StreamSubscription<UserChangeEvent> _subscription;

  @override
  void onReady() {
    super.onReady();
    _subscription =
        LfEventHelper().getEvent().on<UserChangeEvent>().listen((event) {
      update();
    });
  }

  @override
  void onClose() {
    _subscription.cancel();
    super.onClose();
  }
}
